package top.bug.blog.service.impl;

import org.springframework.stereotype.Service;
import top.bug.blog.entity.dto.sys.ServerInfoDTO;
import top.bug.blog.service.MonitorService;
import top.bug.blog.utils.ServerInfoCollectorUtil;

import javax.annotation.Resource;
import javax.sql.DataSource;

/**
 * @author <a href="https://github.com/jiusi66">九思.</a>
 * @email 10837907@qq.com
 * @from <a href="https://www.52bug.top">递归茶馆-www.52bug.top</a>
 * @description 服务监控实现类
 */
@Service
public class MonitorServiceImpl implements MonitorService {

    @Resource
    private DataSource dataSource;

    @Override
    public ServerInfoDTO getServerInfo() {
        return ServerInfoCollectorUtil.collect(dataSource);
    }
}
